package com.lei.service.impl;

import com.lei.dao.RoleDao;
import com.lei.domain.Role;
import com.lei.service.RoleService;

import java.util.List;

/**
 * @ClassName RoleServiceImpl
 * @Description TODO
 * @Author Admin
 * @Date 2021/9/15 10:25
 * @Version 1.0
 */
public class RoleServiceImpl implements RoleService {
    private RoleDao roleDao;

    public void setRoleDao(RoleDao roleDao) {
        this.roleDao = roleDao;
    }

    public List<Role> list() {
       List<Role> roleList= roleDao.findAll();
        return roleList;
    }

    public void save(Role role) {
        roleDao.save(role);
    }

    public void del(Long roleId) {
        roleDao.delRoleUserRel(roleId);
        roleDao.delRole(roleId);
    }
}
